package com.yilin.medical.fragment;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.yilin.medical.R;
import com.yilin.medical.adapter.MessageAdapter;
import com.yilin.medical.model.MessageBean;

/**
 * 内分泌
 * 
 * @author lijianqun
 * 
 */
public class MessageFragment extends Fragment {
	private Context context;
	private View mView;
	private ListView mListView;
	private List<MessageBean> mList;
	private MessageAdapter mAdapter;

	@Override
	public void onAttach(Activity activity) {
		super.onAttach(activity);
		context = activity;
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		mView = View.inflate(context, R.layout.fragment_mymessage, null);
		initView();
		initData();
		return mView;
	}

	private void initData() {
		mList = new ArrayList<MessageBean>();
		for (int i = 0; i < 20; i++) {
			mList.add(new MessageBean());
		}
		mAdapter = new MessageAdapter(context, mList);
		mListView.setAdapter(mAdapter);
	}

	private void initView() {
		mListView = (ListView) mView.findViewById(R.id.lv_mesg);
	}
}
